<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/15
 * Time: 22:09
 */

namespace App\Library\form_builder\src\components;
class Button extends BaseForm
{
    /**
     * 组件类型 普通按钮
     */
    const TYPE_BUTTON = 'button';
    /**
     *
     */
    const TYPE_SUMBIT = 'sumbit';
    /**
     *
     */
    const TYPE_RESET = 'reset';

    protected $type='button';
    /**
     * @param $type
     */
    public function type($type){
        $this->type=$type;
    }
    /**
     * 生成组件
     *
     * @return array
     */

    public function build()
    {
        return [
            'type' => $this->type,
            'field' => $this->field,
            'title' => $this->title,
            'value' => $this->values,
            'props' => $this->props,
            'validate' => $this->valids,
        ];
    }
}